-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add revive-node version #3
base: main
Are you sure you want to change the base?
Conversation
"lint": "npx eslint 'src/**/*.{cjs,js,ts}' && npx prettier --check '**/*.{ts,json,yml,md}'", | ||
"lint:fix": "npx prettier --write '**/*.{ts,json,yml,md}'", | ||
"test": "npm run build && node ./dist/index.test.js" | ||
"test": "npm run build && node ./dist/index.test.js", | ||
"download:revive": "echo 'TODO: Download Revive release from github'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about downloading the resolc.{js,wasm} and worker.js files from the Github Revive release instead of creating another one npm package with Revive compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should end up having both? I.e. a JS release and an NPM package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for the browser JS release, the point is that I don't see the reason to have two separate NPM packages — one for the output of the revive compilation and the other for the NPM js-revive
package.
package.json
Outdated
@@ -32,6 +34,7 @@ | |||
}, | |||
"dependencies": { | |||
"@types/node": "^22.9.0", | |||
"deasync": "^0.1.30", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just temporary solution, will be removed soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/worker.js
Outdated
@@ -0,0 +1,59 @@ | |||
'use strict'; | |||
|
|||
var worker_threads = require('worker_threads'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using CommonJS here, but I compile to an ES module. Therefore, I needed to use Rollup to convert it to CommonJS.
Another consideration is whether we should embed worker.js
directly into resolc.js
to ship a single JavaScript file. However, that approach seems a bit hacky: Web Workers without a separate JavaScript file.
Any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just release both, worker.js
and resolc.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed worker.js
"lint": "npx eslint 'src/**/*.{cjs,js,ts}' && npx prettier --check '**/*.{ts,json,yml,md}'", | ||
"lint:fix": "npx prettier --write '**/*.{ts,json,yml,md}'", | ||
"test": "npm run build && node ./dist/index.test.js" | ||
"test": "npm run build && node ./dist/index.test.js", | ||
"download:revive": "echo 'TODO: Download Revive release from github'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should end up having both? I.e. a JS release and an NPM package
@smiasojed merged #4 |
Test with hardcoded Revive - DO NOT MERGE